﻿Public Class Duelista : Implements IEquatable(Of Duelista)

    Private _ID As String
    Private _Nombre As String
    Private _Telefono As String

    Public Sub New()

    End Sub

    Public Sub New(ByVal id As String, ByVal nombre As String, ByVal telefono As String)
        _ID = id
        _Nombre = nombre
        _Telefono = telefono
    End Sub

    Public Property ID() As String
        Get
            Return _ID
        End Get
        Set(ByVal value As String)
            _ID = value
        End Set
    End Property

    Public Property Nombre() As String
        Get
            Return _Nombre
        End Get
        Set(ByVal value As String)
            _Nombre = value
        End Set
    End Property

    Public Property Telefono() As String
        Get
            Return _Telefono
        End Get
        Set(ByVal value As String)
            If value.Length < 9 OrElse Not value.StartsWith("6") OrElse Not value.StartsWith("9") Then
                _Telefono = Nothing
                Exit Property
            End If
            _Telefono = value
        End Set
    End Property

    Public Function Equals1(ByVal other As Duelista) As Boolean Implements System.IEquatable(Of Duelista).Equals
        Return other.ID = Me.ID
    End Function
End Class